﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EFong.View
{
    public class AppParameters
    {
        public static Contract.User LoginUser { get; set; }

        public static string SystemName { get; set; }

        public static DateTime FetureDateTime
        {
            get
            {
                return new DateTime(3000, 12, 31, 0, 0, 0);
            }
        }

        public static bool AllowEditCustomer { get; set; }

        public static bool IsAdRole
        {
            get
            {
                if (LoginUser == null)
                    return false;

                if (LoginUser.Role == null)
                    return false;

                var item = LoginUser.Role.Authorities.Single(i => i.AuthorizedItem.Name == "高级修改");

                if (item == null)
                    return false;

                return item.Allow;
            }
        }
    }
}
